function t(t) {
    return (t = t.toString())[1] ? t : "0" + t;
}


function formatTime (e) {
    var n = e.getFullYear(), o = e.getMonth() + 1, r = e.getDate(), u = e.getHours(), i = e.getMinutes(), g = e.getSeconds();
    return [ n, o, r ].map(t).join("/") + " " + [ u, i, g ].map(t).join(":");
}

// 校验输入的必须是汉字
function verifyChinese (words) {
    let reg =  /^[\u4E00-\u9FA5]+$/
    if (!reg.test(words)) {
        const App = getApp()
        App.showError("含有非汉字输入！")
        return false
    } else {
        return true
    }
}

// 校验输入字符串不能为''
function verifyNotEmpty (string) {
    if (string === '') {
        let App = getApp()
        App.showError("请输入汉字")
        return false
    } else {
        return true
    }
}

exports.verifyChinese = verifyChinese
exports.verifyNotEmpty = verifyNotEmpty
